/*
-------------------------------------------------

	Mathematics.h

	Dmitriy Kuzmenko (Dgut)

-------------------------------------------------
*/

#ifndef __AUTUMN_MATHEMATICS_H__
#define __AUTUMN_MATHEMATICS_H__

#include "Plane.h"
#include "Vector.h"

typedef Autumn::Plane< float, 2 > plane2f;
typedef Autumn::Plane< float, 3 > plane3f;
typedef Autumn::Plane< int, 2 > plane2i;
typedef Autumn::Plane< int, 3 > plane3i;

typedef Autumn::Vector< float, 2 > vec2f;
typedef Autumn::Vector< float, 3 > vec3f;
typedef Autumn::Vector< int, 2 > vec2i;
typedef Autumn::Vector< int, 3 > vec3i;

template< typename T >
inline const T sign( T value )
{
	return ( value > 0 ) - ( value < 0 );
}

template< typename T >
inline const T clamp( T value, T min, T max )
{
	return value < min ? min : value > max ? max : value;
}

#endif	// !!! __AUTUMN_MATHEMATICS_H__ !!!